#### II Replication ####
### purpose: replicating figure 1 ####
# installing packages ----

list.of.packages = c('ggplot2')
new.packages <- list.of.packages[!(list.of.packages %in% 
                                     installed.packages()[,"Package"])]

if(length(new.packages)) install.packages(new.packages)

# loading packages ----

suppressPackageStartupMessages(
  {
    library(ggplot2)
  }
)

# loading in data ----
belt <- readRDS("~/data/fig_data_belt.RDS")

f1 <- ggplot(belt |> mutate(beltway = as.factor(belt)), aes(year, firm, group = beltway, col = beltway)) + 
  geom_line() + 
  annotate("text", label = "non-beltway", x = 2014, y = 840, col = "black") + 
  annotate("text", label = "beltway area", x = 2014, y = 300, col = "gray60") + 
  scale_color_manual(values=c("black", "gray60"))+
  theme_minimal() + 
  scale_x_continuous(breaks = seq(1990, 2018, by = 2)) + 
  theme(legend.position="none") + 
  labs(y = "the number of unique aid contractors")

ggsave(plot = f1, 
       filename = "~figures/figure1_beltway.jpeg",
       width = 8, height = 5, dpi = 1200)
